#cs ----------------------------------------------------------------------------

 AutoIt Version: 3.3.12.0
 Author: Tody Guo

 Script Function:
	Read Image folder name from Z: letter...

#ce ----------------------------------------------------------------------------

; Script Start - Add your code below here

#include <GUIConstantsEx.au3>
#include <MsgBoxConstants.au3>
#include <File.au3>

Opt("TrayIconHide", 1)

Dim $ImageList

Local $hMainGUI = GUICreate("Image Download List  v1.0.0", 500, 100)
Local $idGO = GUICtrlCreateButton("Start", 350, 20, 75, 25)
Local $idComboBox = GUICtrlCreateCombo("Select Image", 10, 20, 300, 20)

Local $aFileList = _FileListToArray("Z:\", Default, 2, True)
For $i=1 To $aFileList[0]
   $ImageList=$ImageList&"|"&$aFileList[$i]
Next

GUICtrlSetData($idComboBox, $ImageList)
GUISetState(@SW_SHOW, $hMainGUI)

While 1
   Switch GUIGetMsg()
	  Case $GUI_EVENT_CLOSE, $idClose
		 If FileExists("z:\Go.bat") Then FileDelete("z:\Go.bat")
		 ExitLoop
	  Case $idGO
		 $sReadCombo = GUICtrlRead($idComboBox)
		 If FileExists("z:\Go.bat") Then FileDelete("z:\Go.bat")
		 FileWriteLine("z:\Go.bat","@echo off")
		 FileWriteLine("z:\Go.bat","z:")
		 FileWriteLine("z:\Go.bat","cd "&$sReadCombo)
		 FileWriteLine("z:\Go.bat","if exist oem.cmd call oem.cmd")
		 FileWriteLine("z:\Go.bat","if exist gho.cmd call gho.cmd")
		 FileWriteLine("z:\Go.bat","pause")
		 run("z:\Go.bat")
   EndSwitch
WEnd


